package com.jxx.aop;

import com.jxx.vo.SysResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice   //定义全局异常处理
public class SystemException {
    @ExceptionHandler({RuntimeException.class})
    public SysResult fail(Exception e){
        e.printStackTrace();        //输出异常信息
        return SysResult.fail();
    }
}
